// NodeMulop.java

public class NodeMulop extends Node {

    private String mulop;

    /**
     * Constructor
     * @param pos
     * @param mulop
     */
    public NodeMulop(int pos, String mulop) {
		this.pos=pos;
		this.mulop=mulop;
    }

    /**
     * Return the evaluation of the multiple/division operation.
     * @param o1
     * @param o2
     * @return o1*o2 or o1/o2
     * @throws EvalException
     */
    public double op(double o1, double o2) throws EvalException {
		if (mulop.equals("*"))
		    return o1*o2;
		if (mulop.equals("/"))
		    return o1/o2;
		throw new EvalException(pos,"bogus mulop: "+mulop);
    }

}
